<template>
    <div class="details">
        <div class="additem underline">
            <div class="list">
                <div>{{safeInfo.time}}</div>
            </div>
            <div class="list">
                <div><i class="iconfont icon-xiangmu"></i>&nbsp;检查项目：{{safeInfo.safeCheck}}</div>
            </div>
            <div class="list">
                <div><i class="iconfont icon-zerenren"></i>&nbsp;处理人：{{safeInfo.safeDealName}}</div>
            </div>
            <div class="list">
                <div><i class="iconfont icon-shijian"></i>&nbsp;处理时限：{{safeInfo.timelimit}}天</div>
            </div>
            <div class="list">
                <div><i class="iconfont icon-quyu"></i>&nbsp;片区：{{safeInfo.safeArea}}</div>
            </div>
            <div class="list">
                <div><i class="iconfont icon-icon-"></i>&nbsp;点位：{{safeInfo.safeSite}}</div>
            </div>
            <div class="list">
                <div>反应内容：</div>
            </div>
            <div class="list">
                <p style="margin:0;text-indent:2em">{{safeInfo.reactcontent}}</p>
            </div>
            <div class="list">
                <img class="photopath" :src="item" alt="" v-for="item in safeInfo.photopathList" :key="item.value" @click="clickImg($event)">
            </div>
        </div>
        <div class="additem underline" v-for="item in listInfo" :key="item.value">
            <div class="list">
                <div>{{item.changeTime}}</div>
            </div>
            <div class="list">
                <div>处理反馈：</div>
            </div>
            <div class="list">
                <p style="margin:0;text-indent:2em">{{item.changedcontent}}</p>
            </div>
            <div class="list">
                <img class="photopath" :src="item2" alt="" v-for="item2 in item.changePhotopathList" :key="item2.value" @click="clickImg($event)">
            </div>
            <div class="list" v-if="item.result!=null">
                <div>审核结果：<span v-if="item.result==1">通过</span><span v-if="item.result==0">不通过</span></div>
            </div>
            <div class="list" v-if="item.result!=null">
                <img class="photopath" :src="item2" alt="" v-for="item2 in item.audingPhotopathList" :key="item2.value" @click="clickImg($event)">
            </div>
        </div>
        <bigImg v-if="showImg" @clickit="viewImg" :imgSrc="imgSrc" />

        <button type="button" class="btn btn-block btn-primary" @click="$router.push({ path: '/result-sh', query: { safeId: $route.query.safeId,changedId:changedId} })">立即审核</button>
    </div>
</template>

<script>
import bigImg from "@/components/bigImg.vue";

export default {
    data() {
        return {
            safeInfo: {},
            listInfo: [],
            changedId: '',
            showImg: false,
            imgSrc: ''
        }
    },
    components: {
        bigImg
    },
    mounted() {
        this.getSelSafeId()
    },
    methods: {
        getSelSafeId() {
            this.$api.safe.selSafeId({
                safeId: this.$route.query.safeId
            }).then(res => {
                if (res.success) {
                    this.safeInfo = res.data.safeInfo
                    this.listInfo = res.data.list
                    this.changedId = res.data.changedId
                }
            });
        },
        viewImg() {
            this.showImg = false;
        },
        clickImg(e) {
            this.showImg = true;
            // 获取当前图片地址
            this.imgSrc = e.currentTarget.src;
        },
    }
}
</script>

<style lang="less">
</style>

